package com.lun.blog.repostory;

import com.lun.blog.pojo.Picture;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PictureRepository extends JpaRepository<Picture,Long>, JpaSpecificationExecutor<Picture> {

    Picture findByPictureName(String pictureName);

    @Query(value = "SELECT * FROM t_picture ORDER BY create_time ",nativeQuery = true)
    List<Picture> listPicture();
}
